﻿@echo off
chcp 65001

set JENKINS_URL=http://localserver:8080
set USER=read
set TOKEN=11cf454ee6ab03573cb4e3ed31f83737b8

echo 请选择要构建的任务:
echo 0. 退出
echo 1. goodjp-_all
echo 2. goodjp-WebApp
echo 3. goodjp-CompanyAdminApp
echo 4. goodjp-AdminApp

set CHOICE=0
set /p CHOICE="请输入你的选择（0-20），默认是 0: "

if "%CHOICE%"=="0" (
    echo 退出...
    exit /b
)

if "%CHOICE%"=="1" set JOBS=goodjp-_all
if "%CHOICE%"=="2" set JOBS=goodjp-WebApp
if "%CHOICE%"=="3" set JOBS=goodjp-CompanyAdminApp
if "%CHOICE%"=="4" set JOBS=goodjp-AdminApp

echo 正在触发 jenkins 任务，拉取分支 release/beta，发布到测试环境...

for %%J in (%JOBS%) do (
    echo 构建 %%J ...
    curl -X POST %JENKINS_URL%/job/%%J/build --user %USER%:%TOKEN%
)

echo 完成
